﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Yunwei.BizLogic;
using Yunwei.IBizLogic;
using Yunwei.Web.Models;

namespace Yunwei.Web.Controllers
{
    public class HomeController : Controller
    {
        IStaffService _staffServcice;
        IRestaurantService _restaurantService;
        IFoodService _foodService;
        public HomeController()
        {
            _staffServcice = new StaffService();
            _restaurantService = new RestaurantService();
            _foodService = new FoodService();
        }

        public ActionResult Index()
        {
            HomeViewModel hvm = new HomeViewModel();
            hvm.Restaurants = _restaurantService.FindList(20, "", 0, 1).ToList();
            hvm.Staffs = _staffServcice.FindList(20, "", 1, 0, 1).ToList();
            hvm.Foods = _foodService.FindList(5, "", 0, 0, 0, null, null, 1).ToList();
            return View(hvm);
        }

        public ActionResult Error404()
        {
              return View();
        }
    }
}